package com.shd.edanpei.bean;

import com.shd.edanpei.R;
import com.shd.edanpei.db.DaoManager;
import com.shd.edanpei.enums.RoleEnum;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by mc on 2018/10/31.
 * yang-wen-wen
 */

public class MenuModel {


    /**
     * 首页菜单数据
     *
     * @return
     */
    public static List<MenuData> getHomeMenuList() {
        List<MenuData> list = new ArrayList<>();
        int roleType = DaoManager.getInstance().getUserBean().getRoleType();
        if (roleType == RoleEnum.bank.getId()) {
            list.add(new MenuData(1, "银行入口", R.drawable.home_ic_support));
        } else {
            list.add(new MenuData(2, "代理入口", R.drawable.home_ic_apply));
        }
        list.add(new MenuData(3, "E资讯", R.drawable.home_ic_news));
        list.add(new MenuData(4, "帮助中心", R.drawable.home_ic_help));
        list.add(new MenuData(5, "操作指南", R.drawable.home_ic_order));
        return list;
    }

    /**
     * 我的界面菜单
     * "银行经理角色"没有<我的团队>
     */
    public static List<MenuData> getMineMenuList() {
        int roleType = DaoManager.getInstance().getUserBean().getRoleType();
        List<MenuData> list = new ArrayList<>();
        list.add(new MenuData(1, "我的账户", R.drawable.ic_money));
        if (roleType == RoleEnum.boss.getId()
                || roleType == RoleEnum.other.getId()) {
            list.add(new MenuData(6, "我的团队", R.drawable.ic_team));
        }
        list.add(new MenuData(2, "通讯录", R.drawable.ic_contact));
        list.add(new MenuData(3, "意见反馈", R.drawable.ic_opinion));
        list.add(new MenuData(4, "联系客服", R.drawable.ic_survice));
        list.add(new MenuData(7, "一键分享", R.drawable.ic_share));
        list.add(new MenuData(5, "设置", R.drawable.ic_set));

        return list;
    }

    public static class MenuData {

        private int id;
        private String menuName;
        private int menuIcon;

        public MenuData(int id, String menuName, int menuIcon) {
            this.id = id;
            this.menuName = menuName;
            this.menuIcon = menuIcon;
        }

        public int getId() {
            return id;
        }

        public String getMenuName() {
            return menuName;
        }

        public int getMenuIcon() {
            return menuIcon;
        }
    }
}
